package top.huxy.boot.model.dto;

import lombok.Data;
import top.huxy.boot.exception.RequestAbortedException;
import top.huxy.boot.util.StringUtils;
import top.huxy.boot.util.obj.ValidateAble;

/**
 * @author HuXY
 * @Date 2021年12月31日10:18:13
 */
@Data
public class UserLoginForm implements ValidateAble {
    private String username;
    private String password;
    private String yzm;

    @Override
    public void validate() {
        String temp;
        if ((temp = StringUtils.getEmptyParamName("username,password,yzm", username, password, yzm)) != null) {
            throw new RequestAbortedException("缺少参数[" + temp + "]");
        }
    }
}
